package StringDemo;

public class StringDemo4 {
    public static void main(String[] args){
        String s1 ="imooc";
        String s2 = "imooc";
        String s3 = new String("imooc");
        //内容
        System.out.println(s1.equals(s2));//字符串内容相同可认为内容是相同的
        System.out.println(s1.equals(s3));
        //地址
        System.out.println(s1==s2);
        System.out.println(s1==s3);
    }
}
